package com.mzj.saas.mservice.bill.repository;

import com.mzj.saas.mservice.bill.entity.HouseExpenseOther;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface HouseExpenseOtherRepository extends PagingAndSortingRepository<HouseExpenseOther, Long>, JpaSpecificationExecutor<HouseExpenseOther>, JpaRepository<HouseExpenseOther,Long> {
    @Query("from HouseExpenseOther where id=:Id ")
    HouseExpenseOther findById(@Param("Id") String Id);
    List<HouseExpenseOther> findByCommunityIdAndChargeTypeAndEnableStatusAndStatus(String communityId, Integer chargeType, Integer enableStatus, Integer status);

    List<HouseExpenseOther> findByIdInAndEnableStatusAndStatus(List<String> ids,Integer enableStatus, Integer status);

    List<HouseExpenseOther> findByCommunityIdAndChargeTypeAndStatus(String communityId, Integer chargeType, Integer status);

    List<HouseExpenseOther> findByNameAndType(String name,Integer type);

    List<HouseExpenseOther> findByNameAndTypeAndOrgIdAndStatus(String name,Integer type,Long orgId,Integer Status);

}
